import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex)

let host = process.env.VUE_APP_BASE_URL // 配置了生产环境和开发环境，此处会根据环境不同而请求不同的地址，在环境配置中设置请求地址

const state = {
  basicApiUrl: host,
  topath: '/'
}

const mutations = {
  changeTopath(state, msg) {
    state.topath = msg
  },
}

const store = new vuex.Store({
  state,
  mutations
})

export default store